package com.kaiwukj.android.ufamily.mvp.ui.page.mine.house.door;

import com.blankj.utilcode.util.TimeUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.kaiwukj.android.ufamily.R;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.DoorAccessRecordResult;

import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;

public class DoorRecordAdapter extends BaseQuickAdapter<DoorAccessRecordResult, BaseViewHolder> {

    public DoorRecordAdapter() {
        super(R.layout.item_door_access_record, new ArrayList<>());
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, DoorAccessRecordResult result) {
        holder.setText(R.id.tv_desc, String.format("%s %s", result.getCaptureType(), result.getBuildingName()));
        holder.setText(R.id.tv_date, TimeUtils.getFriendlyTimeSpanByNow(result.getOpenDoorDate()));
    }
}
